#import "dfhgwhruebvhrheygeneralizeignore.h"
#import "dfhgwhruebvhrheyoutwarddelegate.h"
#import "dfhgwhruebvhrheystaindental.h"
@interface dfhgwhruebvhrheystaindental ()<dhgfywegwygeydwdefinitelyleak>
@property (nonatomic, strong) dfhgwhruebvhrheygeneralizeignore *codeView;
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UIImageView *iconIV;
@property (weak, nonatomic) IBOutlet UIView *passwordView;
@property (weak, nonatomic) IBOutlet UILabel *tipsTextLabel;
@property (weak, nonatomic) IBOutlet UILabel *titleTextLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleHeightConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *tipsTextHeightConstraint;
@end
@implementation dfhgwhruebvhrheystaindental {
	CAGradientLayer *gradientLayer;
	void(^_click)(UIButton *sender, NSString *code);
}
- (void)awakeFromNib {
	[super awakeFromNib];
	[self setUI];
}
- (void)setUI {
	self.codeView = [[dfhgwhruebvhrheygeneralizeignore alloc] initWithCount:6 margin:20.0];
	self.codeView.backgroundColor = [UIColor clearColor];
	self.codeView.codeTextColor = primary_color.dhgfywegwygeydwlearneddesignate;
	self.codeView.underLineColor = @"#AAAAAA".dhgfywegwygeydwlearneddesignate;
	self.codeView.delegate = self;
	[self.passwordView addSubview:self.codeView];
	self.bgView.layer.masksToBounds = YES;
	[self bringSubviewToFront:self.iconIV];
	gradientLayer = [CAGradientLayer layer];
	gradientLayer.startPoint = CGPointMake(0, 0);
	gradientLayer.endPoint = CGPointMake(0, 1);
	gradientLayer.colors = @[(__bridge  id)@"#E8F3FF".dhgfywegwygeydwlearneddesignate.CGColor, (__bridge  id)[UIColor whiteColor].CGColor];
	gradientLayer.locations = @[@(0.3), @(1.0)];
	[self.bgView.layer insertSublayer:gradientLayer atIndex:0];
}
- (void)configure:(NSString *)title andTips:(NSString *)text withBtnsClick:(void(^)(UIButton *sender, NSString *code))click {
	_click = click;
	self.tipsTextLabel.text = text;
	self.titleTextLabel.text = title;
}
- (IBAction)surePopViewBtnsClick:(UIButton *)sender {
	if (sender.tag == 101) {
		if (self.passwd.length != 6) {
			return [dfhgwhruebvhrheyoptionsaving.keyWindow show:@"Please enter the correct password"];
		}
	}
	if (_click) {
		_click(sender, self.passwd);
	}
}
- (void)layoutSubviews {
	[super layoutSubviews];
	[self.codeView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.edges.equalTo(self.passwordView);
	}];
	gradientLayer.frame = self.bgView.bounds;
}
- (void)codeViewDidInputCompleted:(dfhgwhruebvhrheygeneralizeignore *)codeView {
	self.passwd = codeView.code;
}
@end
